<html>
	<?
	include 'web/header.phtml';
	?>
<style>
	.ProductTable table {
		font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
		font-size: 12px;
		width: 974px;
		text-align: left;
		border-collapse: collapse;
		margin: 20px;
	}
	.ProductTable thead {
		display: table-header-group;
		vertical-align: middle;
		border-color: inherit;
	}
	.ProductTable th {
		font-size: 13px;
		font-weight: normal;
		background: #B9C9FE;
		border-bottom: 1px solid white;
		color: #039;
		padding: 8px;
	}
	.ProductTable td {
		background: #E8EDFF;
		border-bottom: 1px solid white;
		color: #669;
		border-top: 1px solid transparent;
		padding: 8px;
	}
	.ProductTable tr:hover td {
		background: #D0DAFD;
		color: #339;
	}
	</style>
	<script type="text/javascript"></script>

	<body>

		<?
		include 'web/body.header.phtml';
		include 'web/body.menu.phtml';
		?>

		<div id="page">

			<?
			include 'web/body.banner.phtml';
			?>

			<div style="clear: both; margin-bottom: 20px;"></div>

			<input type='button'value='Add new' onclick=addNewProductForm() style='width:60px'/>
			<?=$MSS ?>
			<form name="search" action="admin.php?view=product" method="post"  enctype="multipart/form-data" onsubmit="return ValidateForm();">
			<div class="ProductTable">
			<table>
									
									<tr>
										<td>Name:</td><td>
										<input type="text" name="Name" size=20 maxlength=200>
										</td>
										<td> </td><td>
										<select name="PriceFrom">
											<option value="0">Price From</option>
											<option value="100">100</option>
											<option value="200">200</option>
											<option value="300">300</option>
											<option value="400">400</option>
											<option value="500">500</option>
										</select></td>
										<td> </td><td>
										<select name="PriceTo">
											<option value="0">Price To</option>
											<option value="100">100</option>
											<option value="200">200</option>
											<option value="300">300</option>
											<option value="400">400</option>
											<option value="500">500</option>
										</select>
										</td>
										<td>
										<input type="submit" value="Search" name="Submit"/>
										</td>
									</tr>
								</table>
			</div>
			</form>
			
			<div id="productForm" class="ProductTable">
				<form name="addproduct" action="admin.php?view=product" method="post"  enctype="multipart/form-data" onsubmit="return ValidateForm();">
					
					<table>
						<input type=hidden name="ProductID" id="ProductID">
						<tr>
							<td>Name:</td><td>
							<input type="text" name="Name" id="Name" size=50 maxlength=200>
							</td>
						</tr>
						<tr>
							<td>Price:</td><td>
							<input type="text" name="Price" id="Price" size=50 maxlength=200>
							</td>
						</tr>
						<tr>
							<td>Quantity:</td><td>
							<input type="text" name="Quantity" id="Quantity" size=50 maxlength=200>
							</td>
						</tr>

						<tr>
							<td>Category:</td>
							<td>
							<select name="Category">
								<option value="M-Shirt">M-Shirt</option>
								<option value="M-Paints">M-Paints</option>
								<option value="M-Belt">M-Belt</option>
								<option value="M-Accessories">M-Accessories</option>
								<option value="F-Shirt">F-Shirt</option>
								<option value="F-Paints">F-Paints</option>
								<option value="F-Belt">F-Belt</option>
								<option value="F-Accessories">F-Accessories</option>
							</select></td>
						</tr>
						<tr>
							<td>Image</td>
							<td>
							<input type="file" name="ImageName" id="ImageName" size="32" style="width:335px" />
							</td>
						</tr>
						<tr>
							<td>Description:</td>
							<td>							<textarea id="Description" name="Description" cols="50" rows="5" style="width:335px"></textarea></td>
						</tr>

						
						<tr>
							<td colspan="2" align="right">
							<input type="submit" value="Add" name="Submit"/>
							<input type="submit" value="Modify" name="Submit"/>
							<input type="reset" value="Reset" name="Clear">
							</td>

						</tr>
					</table>

				</form>
			</div>
			<div class="ProductTable">
				<!-- start content -- -->
				<?echo $PageLink?>
				<table>

					<?php
					if (count($products) > 0) {
						echo "<thead>
<tr>
<th>Name</th><th>Category</th><th>Quantity</th><th>Price</th><th>Action</th>
</tr>
</thead>";
						foreach ($products as $product) {
							echo "<tr id=$product[ProductID]>
<td>$product[Name]</td>
<td>$product[Category]</td>
<td>$product[Quantity]</td>
<td>$product[Price]</td>
<td><input type='button'value='Select' onclick=selectProduct($product[ProductID]) style='width:60px'/>
<button onclick=deleteProduct($product[ProductID])>Delete</button></td>
</tr>";
						}
					}
					?>
				</table>
			</div>

			<!-- end content -- -->
		</div>

		<?
		include 'web/body.wrapper.phtml';
		?>
	</body>
</html>

